﻿using HuiZe.education.Model;
using PropertyChanged;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace HuiZe.education.View
{
    /// <summary>
    /// ShowDialogView2.xaml 的交互逻辑
    /// </summary>
    /// 
    /// <summary>
    /// ShowDialogView.xaml 的交互逻辑
    /// </summary>


    public partial class ShowDialogComboxView : Window
    {


        public List<string> Items { get; set; } = new List<string>();
        //  public List<string>

        public string SelectClass = "";
        public ShowDialogComboxView()
        {
            InitializeComponent();
            foreach (var a in HuiZeeducation.Instance.Classes)
            {
                Items.Add(a.name);
            }
        }



        private void YCButton_Click(object sender, RoutedEventArgs e)
        {
            SelectClass = (string)TxtContent.Text;
            if (string.IsNullOrEmpty(SelectClass))
            {
                return;
            }

            if (HuiZeeducation.Instance.Classing)
            {
                ShowDialogView_Class showDialogView = new ShowDialogView_Class("当前正在授课，请选择下列操作");
                showDialogView.ShowDialog();
                if (showDialogView.DialogResult == false)
                {
                    HuiZeeducation.Instance.Classing = false;
                    this.Close();
                    return;
                }
            }

            this.DialogResult = true;
            this.Close();
        }

        private void YCButton_Click_1(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void Close_Window(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }
    }
}
